Update bash-completion
authorgentoo90 <gentoo90@gmail.com>
Sat, 28 Nov 2015 08:56:06 +0000 (10:56 +0200)
committergentoo90 <gentoo90@gmail.com>
Sat, 28 Nov 2015 08:56:06 +0000 (10:56 +0200)
* completion for install, uninstall and rustdoc
* completion for --color variants
* some missing options

src/etc/cargo.bashcomp.sh

index 14540ca14b46ccfff9787ebce0d0bec5fb464830..9d04d5f16035dd9111d7c17351d2abeda2d1eb86 100644 (file)
@@ -9,6 +9,7 @@ _cargo()
        cmd=${words[1]}
 
        local vcs='git hg none'
+       local color='auto always never'
 
        local opt_help='-h --help'
        local opt_verbose='-v --verbose'
@@ -23,26 +24,30 @@ _cargo()
        local opt___nocmd="$opt_common -V --version --list"
        local opt__bench="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --no-run"
        local opt__build="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --release"
-       local opt__clean="$opt_common $opt_pkg $opt_mani --target"
-       local opt__doc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --open --no-deps"
+       local opt__clean="$opt_common $opt_pkg $opt_mani --target --release"
+       local opt__doc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --open --no-deps --release"
        local opt__fetch="$opt_common $opt_mani"
        local opt__generate_lockfile="${opt__fetch}"
        local opt__git_checkout="$opt_common --reference --url"
+       local opt__help="$opt_help"
+       local opt__install="$opt_common $opt_feat $opt_jobs --bin --branch --debug --example --git --list --path --rev --root --tag --vers"
        local opt__locate_project="$opt_mani -h --help"
        local opt__login="$opt_common --host"
        local opt__new="$opt_common --vcs --bin --name"
        local opt__owner="$opt_common -a --add -r --remove -l --list --index --token"
+       local opt__package="$opt_common $opt_mani -l --list --no-verify --no-metadata"
        local opt__pkgid="${opt__fetch}"
        local opt__publish="$opt_common $opt_mani --host --token --no-verify"
-       local opt__read_manifest="$opt_help $opt_verbose $opt_mani"
+       local opt__read_manifest="$opt_help $opt_verbose $opt_mani --color"
        local opt__run="$opt_common $opt_feat $opt_mani $opt_jobs --target --bin --example --release"
        local opt__rustc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --release"
+       local opt__rustdoc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --release --open"
        local opt__search="$opt_common --host"
-       local opt__test="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --no-run --release"
+       local opt__test="$opt_common $opt_pkg $opt_feat $opt_mani $opt_jobs --target --lib --bin --test --bench --example --no-run --release --no-fail-fast"
+       local opt__uninstall="$opt_common --bin --root"
        local opt__update="$opt_common $opt_pkg $opt_mani --aggressive --precise"
-       local opt__package="$opt_common $opt_mani -l --list --no-verify --no-metadata"
        local opt__verify_project="${opt__fetch}"
-       local opt__version="$opt_help $opt_verbose"
+       local opt__version="$opt_help $opt_verbose --color"
        local opt__yank="$opt_common --vers --undo --index --token"
 
        if [[ $cword -eq 1 ]]; then
@@ -56,6 +61,9 @@ _cargo()
                        --vcs)
                                COMPREPLY=( $( compgen -W "$vcs" -- "$cur" ) )
                                ;;
+                       --color)
+                               COMPREPLY=( $( compgen -W "$color" -- "$cur" ) )
+                               ;;
                        --manifest-path)
                                _filedir toml
                                ;;